package com.jiazhong.可变参数;

public class Demo02 {
    public static void main(String[] args) {
        Math math = new Math();
        System.out.println(math.getMath(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
    }
}

class Math {
    public int getMath(int... nums) {
        int res = 0;
        for (int i = 0; i < nums.length; i++) {
            res += nums[i];
        }
        return res;
    }
}
